//
//  UIView+Rotation.m
//  LYLazizDevelopDemo
//
//  Created by xbn_iMac on 2016/11/10.
//  Copyright © 2016年 XBN. All rights reserved.
//

#import "UIView+Rotation.h"

@implementation UIView (Rotation)

- (void)rotation:(UIImageOrientation)orientation {
    switch (orientation) {
        case UIImageOrientationLeft:
            self.transform = CGAffineTransformMakeRotation((90.0f * M_PI) / 180.0f);
            break;
        case UIImageOrientationRight:
            self.transform = CGAffineTransformMakeRotation((270.0f * M_PI) / 180.0f);

            break;
        case UIImageOrientationDown:
            self.transform = CGAffineTransformMakeRotation((180.0f * M_PI) / 180.0f);

            break;
        default:

            break;
    }
}

- (void)setLanguageRotaion {
    if ([LZLanguageManager shareInstance].getLanguageType == LanguageType_Ar) {
        [self rotation:UIImageOrientationDown];
    }
    else {
        [self rotation:UIImageOrientationUp];
    }
}

@end
